package com.guanyong.dao;


import com.guanyong.model.UserBaseModel;
import com.guanyong.model.UserInfoModel;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by mxk on 2017/5/26.
 * 用户附属信息
 */
@Mapper
public interface IUserInfoDaoMapper {
    //
    int insert( UserInfoModel record);

    int update( UserInfoModel record);

    @Select("SELECT * FROM t_ad_userinfo INNER JOIN t_ad_userbase ON t_ad_userinfo" +
            ".f_id=t_ad_userbase.f_id" +
            " WHERE t_ad_userbase.f_id=#{#fId}")
    @ResultMap("UserInfoResultMap")
    UserInfoModel selectByPrimaryKey(String fId);

    @Select("SELECT * FROM t_ad_userinfo INNER JOIN t_ad_userbase ON t_ad_userinfo" +
            ".f_id=t_ad_userbase.f_id " +
            " WHERE t_ad_userbase.f_id in (${idlist})")
    @ResultMap("UserInfoResultMap")
    List<UserInfoModel> selectUserInfoByIdList(@Param("idlist") String idlist);





    List<UserInfoModel> SelectUserList(@Param("userBase")UserBaseModel userBase,
                                       @Param("isvip")Integer isvip,
                                       @Param("btime")String btime,
                                       @Param("etime")String etime,
                                       @Param("offset")Integer offset,
                                       @Param("limit") Integer limit);

    Integer SelectUserListCount(@Param("userBase")UserBaseModel userBaseModel,
                                @Param("isvip")Integer isvip,
                                @Param("btime")String btime,
                                @Param("etime")String etime);
}
